/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cms.dataaccess.hibernate;

import cms.dataaccess.TimeLineDAO;
import cms.exceptions.HibernateAccessLayerException;
import dto.Timeline;
import java.util.List;

/**
 *
 * @author TauPo
 */
public class TimeLineDAOImpl extends AbstractDAO implements TimeLineDAO {

    @Override
    public void deleteTimeline(Timeline timeline) throws HibernateAccessLayerException {
     this.delete(timeline);
    }

    @Override
    public void updateTimeline(Timeline timeline) throws HibernateAccessLayerException {
       this.saveOrUpdate(timeline);
    }

    @Override
    public void insertTimeline(Timeline timeline) throws HibernateAccessLayerException {
       this.saveOrUpdate(timeline);
    }

    @Override
    public List<Timeline> findAllTimeline() throws HibernateAccessLayerException {
       return  (List<Timeline>)this.findAll(Timeline.class);
    }

    @Override
    public Timeline findTimeline(String conferenceName) throws HibernateAccessLayerException {
       return (Timeline) this.find(Timeline.class, conferenceName);
    }

    @Override
    public List<Timeline> findByCustomizeQuery(String queryString) throws HibernateAccessLayerException {
            try {  
           return (List<Timeline>)this.findByCustomizeQuery(Timeline.class,queryString);
        } catch (Throwable t) {
            throw new HibernateAccessLayerException(t.toString());
            
        }
    }
    

}
